
#ifndef Velyn_aDrawable_h
#define Velyn_aDrawable_h

#include "TMesh.h"
#include "IDrawable.h"
#include "DuelPyrmaid.h"

namespace Velyn {
    
    /*
     * Drawable uses a strategy design pattern for drawables
     */
    class Drawable {
        
    private:
        
        IDrawable* drawable;
        
    public:
        
        /*
         * Types of drawables to specify for drawable
         */
        enum DrawableType {
            DUELPYRAMID
        };
        
        Drawable() {
            drawable = NULL;
        }
        
        Drawable(IDrawable* d) : drawable(d) {}
        
        Drawable(DrawableType drawableType) {
            
            switch(drawableType) {
                    
                case(DUELPYRAMID): {
                    drawable = new DuelPyramid();
                } break;
                    
                default: {} break;
            }
        }
        
        ~Drawable() {
            delete drawable;
        }
        
        void setDrawable(IDrawable* d) {
            
            if(drawable != NULL) {
                delete drawable;
            }
            
            drawable = d;
        }
        
        void draw(TriangleMesh* mesh) {
            drawable->draw(mesh);
        }
    };
}

#endif
